package com.better517na.elasticseach;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Main {

    private static Random KeyRand = new Random(System.currentTimeMillis());

    private static SimpleDateFormat df = new SimpleDateFormat("yyMMddHHmmss");

    public static void main(String[] args) {
        String fffStr = df.format(new Date());
        String keyid = "";
        keyid += fffStr;
        // 随机码（8位【不足8位补足8位】）+
        keyid +=  String.format("%1$08d",KeyRand.nextInt(10000));
        System.out.println(keyid);
    }
}
